package com.runtime.hongyunuser.controller;

public class TempPasswordUpdate {
    //重置密码
    public static void main(String[] args) {
        // 假设原始密码是 "12345678"
//        String originalPassword = "12345678";
        String originalPassword = "22222222";
        String salt = PasswordUtil.generateSalt();
        String hash = PasswordUtil.hashWithSalt(originalPassword, salt);
        String combined = PasswordUtil.combineSaltAndHash(salt, hash);

        // 这里执行数据库更新，将ID=1的密码字段更新为combined值
        //这里只是提供重置的sql语句，并没有重置操作
        System.out.println("UPDATE users SET passwordHash = '" + combined + "' WHERE userId = 1;");
    }
}
